package com.ruoyi.net.service.impl;

import java.util.List;
import com.ruoyi.common.utils.DateUtils;
import com.ruoyi.common.utils.SecurityUtils;
import com.ruoyi.common.utils.StringUtils;
import com.ruoyi.common.utils.uuid.IdUtils;
import org.springframework.beans.factory.annotation.Autowired;
import org.springframework.stereotype.Service;
import com.ruoyi.net.mapper.ElementDcnTransmitMapper;
import com.ruoyi.net.domain.ElementDcnTransmit;
import com.ruoyi.net.service.IElementDcnTransmitService;

/**
 * 网元-DCN配置-DCN转发配置Service业务层处理
 * 
 * @author net
 * @date 2024-11-17
 */
@Service
public class ElementDcnTransmitServiceImpl implements IElementDcnTransmitService 
{
    @Autowired
    private ElementDcnTransmitMapper elementDcnTransmitMapper;

    /**
     * 查询网元-DCN配置-DCN转发配置
     * 
     * @param id 网元-DCN配置-DCN转发配置主键
     * @return 网元-DCN配置-DCN转发配置
     */
    @Override
    public ElementDcnTransmit selectElementDcnTransmitById(String id)
    {
        return elementDcnTransmitMapper.selectElementDcnTransmitById(id);
    }

    /**
     * 查询网元-DCN配置-DCN转发配置列表
     * 
     * @param elementDcnTransmit 网元-DCN配置-DCN转发配置
     * @return 网元-DCN配置-DCN转发配置
     */
    @Override
    public List<ElementDcnTransmit> selectElementDcnTransmitList(ElementDcnTransmit elementDcnTransmit)
    {
        return elementDcnTransmitMapper.selectElementDcnTransmitList(elementDcnTransmit);
    }

    /**
     * 新增网元-DCN配置-DCN转发配置
     * 
     * @param elementDcnTransmit 网元-DCN配置-DCN转发配置
     * @return 结果
     */
    @Override
    public int insertElementDcnTransmit(ElementDcnTransmit elementDcnTransmit)
    {
        String uuid = IdUtils.simpleUUID();
        if (StringUtils.isEmpty(elementDcnTransmit.getId())) {
            elementDcnTransmit.setId(uuid);
        }
        elementDcnTransmit.setCreateBy(SecurityUtils.getUsername());
        elementDcnTransmit.setCreateTime(DateUtils.getNowDate());
        elementDcnTransmit.setUpdateBy(SecurityUtils.getUsername());
        elementDcnTransmit.setUpdateTime(DateUtils.getNowDate());
        return elementDcnTransmitMapper.insertElementDcnTransmit(elementDcnTransmit);
    }

    /**
     * 修改网元-DCN配置-DCN转发配置
     * 
     * @param elementDcnTransmit 网元-DCN配置-DCN转发配置
     * @return 结果
     */
    @Override
    public int updateElementDcnTransmit(ElementDcnTransmit elementDcnTransmit)
    {
        elementDcnTransmit.setUpdateBy(SecurityUtils.getUsername());
        elementDcnTransmit.setUpdateTime(DateUtils.getNowDate());
        return elementDcnTransmitMapper.updateElementDcnTransmit(elementDcnTransmit);
    }

    /**
     * 批量删除网元-DCN配置-DCN转发配置
     * 
     * @param ids 需要删除的网元-DCN配置-DCN转发配置主键
     * @return 结果
     */
    @Override
    public int deleteElementDcnTransmitByIds(String[] ids)
    {
        return elementDcnTransmitMapper.deleteElementDcnTransmitByIds(ids);
    }

    /**
     * 删除网元-DCN配置-DCN转发配置信息
     * 
     * @param id 网元-DCN配置-DCN转发配置主键
     * @return 结果
     */
    @Override
    public int deleteElementDcnTransmitById(String id)
    {
        return elementDcnTransmitMapper.deleteElementDcnTransmitById(id);
    }
}
